#ifndef __PHYSICS__VIEWPORT__INCLUDED__HH__
#define __PHYSICS__VIEWPORT__INCLUDED__HH__

#include <Ogre.h>
#include <QtGui>
#include "OgreSubWidget.h"
#include "LitPhysicsBody.h"

class PhysicsViewport : public OgreSubWidget, public Ogre::FrameListener
{
	Q_OBJECT

protected:
	Lit::EntityPtr					mEntity;
	Lit::EntityPtr					mFloor;
	Lit::Physics::BodyPtr			mFloorBody;
	MouseDrag						mDrag;

public:
	
	PhysicsViewport( QWidget*parent ) ;
	~PhysicsViewport();

	void createScene( );
	void destroyScene( );


	void fitEntity() ;
	void replaceMesh( const std::string &name );

	bool frameRenderingQueued( const Ogre::FrameEvent& evt );
	
	void mousePressEvent( QMouseEvent*evt );
	void mouseMoveEvent( QMouseEvent*evt );
	void mouseReleaseEvent( QMouseEvent*evt );

protected slots:
	void ogreInitialise();
	void ogreShutdown();
};


#endif